<#escape x as (x)!?html>
<head>
    <script type="text/javascript">
        var menuId = "Settings_User";

        function editUser(e) {
            var userName = e.parents().find("input[name='userName']").val();
            $("#mainForm").find("input[name='userName']").val(userName);
            $("#mainForm").submit();
        }
    </script>
</head>
<body>

<form id="mainForm" method="GET" action="edit.action">
    <input type="hidden" name="userName"/>
</form>

<table>
    <caption>
        <div class="tools border">Users:</div>
    </caption>
</table>

<table>
    <thead>
    <th>UserName</th>
    <th>Status</th>
    <th>Privileges</th>
    <th>Operation</th>
    </thead>
    <tbody>
        <#list users as user>
        <tr>
            <td>${user.name}<input type="hidden" name="userName" value="${user.name}"/></td>
            <td>${user.disabled?string("Disabled","Enabled")}</td>
            <td>
                <#list user.roles as role>${role.description};</#list>
            </td>
            <td><input type="button" value="Edit" class="btn" onclick="editUser($(this))"/></td>
        </tr>
        </#list>
    </tbody>
</table>

</body>
</#escape>